package yt.demo.appcoresystem.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import yt.demo.appcommondb.base.BaseEntity;

import java.util.Date;
import java.util.List;

@EqualsAndHashCode(callSuper = false)
@Data
@Schema(name = "SystemLoginLog", description = "登录日志")

public class SystemOperLog extends BaseEntity<SystemOperLog> {

    @TableId
    @Schema(name = "id", description = "主键ID")
    @NotNull(message = "id不能为空") // 更新时确保此字段不能为空
    private Long id;

    @Schema(description = "用户名")
    private String username;

    @Schema(description = "请求方式")
    private String method;

    @Schema(description = "请求路由")
    private String router;

    @Schema(description = "业务名称")
    private String serviceName;

    @Schema(description = "IP")
    private String ip;

    @Schema(description = "IP所属地")
    private String ipLocation;

    @Schema(description = "请求数据")
    private String requestBody;

    @Schema(description = "请求头")
    private String requestHeaders;

    @Schema(description = "响应状态码")
    private Integer responseCode;

    @Schema(description = "响应头")
    private String responseHeaders;

    @Schema(description = "响应数据")
    private String responseBody;

    @TableField(exist = false)
    private List<String> searchTime;

    @TableField(exist = false)
    private Date deletedAt;

}
